<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    //工厂模式
    function car(){
        var Car = new Object();
        Car.name = "自由光";
        Car.color = "黑";
        Car.price = "1000000";
        Car.run = function () {
            console.log(this.name+this.color+"色价格是"+this.price+"我要开车啦！");

        }
        return Car;
    }
    var str = car();
    str.run();
</script>
</body>
</html>